﻿using System;
using System.ComponentModel;
using System.Linq;

namespace Clancy.Data
{
    public class VideoSourceFilterInfoTypeConverter : TypeConverter
    {
        public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
        {
            return (destinationType == typeof(string));
        }

        public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
        {
            VideoSourceFilterInfo filterInfo = value as VideoSourceFilterInfo;
            //FilterInfo filterInfo = value as FilterInfo;
            if (filterInfo == null)
                return string.Empty;

            return filterInfo.Name;
        }
    }
}